/**
 * @Author: 健聪
 * @Description: 条件表达式
 * @Date: 2024/01/11
 */
void main() {
  int gender = 0;
  // 三目表达式
  // String str = gender == 0 ? 'Male' : 'Female';
  String str = gender == 0 ? "Male=$gender" : "Female=$gender";
  print(str);

  String? a = null; // 当a值为空时，将b值赋值给a
  String b = "Java";
  String c = a ?? b;
  print(c);
}
